#include "clientprotocolaction.h"

/*
 * Client Connection Action
 */

ClientConnectionAction::ClientConnectionAction(ConnectionFunction function, Friend* f) : function(function), f(f) { }

ActionType ClientConnectionAction::getType() {
	return TConnection;
}

ConnectionFunction ClientConnectionAction::getFunction() {
	return function;
}

Friend* ClientConnectionAction::getFriend() {
	return f;
}

/*
 * Client Chat Action
 */
ClientChatAction::ClientChatAction(ChatFunction function, Chat* chat, QString message) : function(function), chat(chat), message(message) { }

ClientChatAction::ClientChatAction(ChatFunction function, Chat* chat, Friend* f, QString message) : function(function), chat(chat), f(f), message(message) { }

ActionType ClientChatAction::getType() {
	return TChat;
}

ChatFunction ClientChatAction::getFunction() {
	return function;
}

Chat* ClientChatAction::getChat() {
	return chat;
}

QString ClientChatAction::getMessage() {
	return message;
}

Friend* ClientChatAction::getFriend() {
	return f;
}

/*
 * Client User Action
 */

ClientUserAction::ClientUserAction(UserFunction function, Friend* f) : function(function), f(f) { }

ClientUserAction::ClientUserAction(UserFunction function, QList<Friend*> friends) : function(function), friends(friends) { }

ClientUserAction::ClientUserAction(UserFunction function, bool isPasswordOk) : function(function), isPasswordOk(isPasswordOk) { }

ActionType ClientUserAction::getType() {
	return TUser;
}

UserFunction ClientUserAction::getFunction() {
	return function;
}

Friend* ClientUserAction::getFriend() {
	return f;
}

QList<Friend*> ClientUserAction::getFriends() {
	return friends;
}

bool ClientUserAction::getPasswordOk() {
	return isPasswordOk;
}

/*
 * Client Friend Action
 */

ClientFriendAction::ClientFriendAction(FriendFunction function, QString login) : function(function), login(login) {
}

ClientFriendAction::ClientFriendAction(FriendFunction function, Friend* f) : function(function), f(f) { }

ActionType ClientFriendAction::getType() {
	return TFriend;
}

FriendFunction ClientFriendAction::getFunction() {
	return function;
}

QString ClientFriendAction::getLogin() {
	return login;
}

Friend* ClientFriendAction::getFriend() {
	return f;
}
